#include<stdio.h>
int sys(char *s)
{
    int i,len=strlen(s);
    for(i=0; i<len/2; i++)
        if(s[i]-s[len-1-i])
            return 0;
    return 1;
}
int sys2(char *s)
{
    char *p=s,*q=s+strlen(s)-1;
    while(p<q)
    {
        if(*p!=*q)
            return 0;
        p++,q--;
    }
    return 1;
}

int main()
{
    char s[100];
    while(scanf("%s",s)==1)
    {
        while(strlen(s)%2==0&&sys2(s))
            s[strlen(s)/2]=0;
        printf("%d\n",strlen(s));
    }
    return 0;
}



